# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=libhandy1
pkgver=1.6.1
pkgrel=0
pkgdesc="Library full of GTK+ widgets for mobile phones"
url="https://gitlab.gnome.org/GNOME/libhandy"
arch="all !s390x !riscv64" # blocked by rust -> adwaita-icon-theme
license="LGPL-2.0-or-later"
makedepends="meson glib-dev gtk+3.0-dev vala py3-setuptools gobject-introspection-dev
	glade-dev"
checkdepends="xvfb-run ibus adwaita-icon-theme ttf-cantarell"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-lang"
source="https://download.gnome.org/sources/libhandy/${pkgver%.*}/libhandy-$pkgver.tar.xz
	"
builddir="$srcdir/libhandy-$pkgver"

if [ "$CARCH" = "armhf" ]; then
	options="!check"; # tests fail on armhf
fi

build() {
	abuild-meson \
		-Dexamples=true \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	xvfb-run meson test --timeout-multiplier=2 --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

dev() {
	default_dev

	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr
}

sha512sums="
1fddf72d7e6d97f12c879a512baeef80e32be4108640b2ff64c5b7dec68d8e2da8f9a2da3c1cb6cde8c2e672f4225e7db698f794641264e64ee9af3c68dbfbb3  libhandy-1.6.1.tar.xz
"
